<!--_meta 作为公共模版分离出去-->
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8"/>
<meta name="renderer" content="webkit|ie-comp|ie-stand"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
<meta name="_csrf" id="_csrf" th:content="${_csrf.token}"/>
<meta name="_csrf_header" id="_csrf_header" th:content="${_csrf.headerName}"/>
<LINK rel="Bookmark" href="/favicon.ico" />
<LINK rel="Shortcut Icon" href="/favicon.ico" />
<!--[if lt IE 9]>
<script type="text/javascript" src="lib/html5.js"></script>
<script type="text/javascript" src="lib/respond.min.js"></script>
<script type="text/javascript" src="lib/PIE_IE678.js"></script>
<![endif]-->
<link rel="stylesheet" type="text/css" href="/static/h-ui/css/H-ui.min.css" />
<link rel="stylesheet" type="text/css" href="/static/h-ui.admin/css/H-ui.admin.css" />
<link rel="stylesheet" type="text/css" href="/lib/Hui-iconfont/1.0.7/iconfont.css" />
<link rel="stylesheet" type="text/css" href="/lib/icheck/icheck.css" />
<link rel="stylesheet" type="text/css" href="/static/h-ui.admin/skin/default/skin.css" id="skin" />
<link rel="stylesheet" type="text/css" href="/static/h-ui.admin/css/style.css" />

<!--[if IE 6]>
<script type="text/javascript" src="http://lib.h-ui.net/DD_belatedPNG_0.0.8a-min.js" ></script>
<script>DD_belatedPNG.fix('*');</script>
<![endif]-->
<!--/meta 作为公共模版分离出去-->

<title>添加商品 - H-ui.admin v2.3</title>
<meta name="keywords" content="H-ui.admin v2.3,H-ui网站后台模版,后台模版下载,后台管理系统模版,HTML后台模版下载"/>
<meta name="description" content="H-ui.admin v2.3，是一款由国人开发的轻量级扁平化网站后台模板，完全免费开源的网站后台管理系统模版，适合中小型CMS后台系统。"/>
</head>
<body>
<article class="page-container">

<!-- 修改直通车 -->
	<form th:if="${throughTrain}" action="/shop/editShop"  method="post" class="form form-horizontal" id="form-member-add">
		<input type="hidden"  th:name="${_csrf.parameterName}"
		th:value="${_csrf.token}"/>
		<input type="hidden" name="id" th:value="${throughTrain.id}"/>
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>商品名：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<input type="text" class="input-text" th:value="${throughTrain.name}" placeholder=""  name="name" />
				
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>价格：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<input  type="text" class="input-text" th:value="${throughTrain.price}" placeholder=""  name="price"/>
			</div>
		</div>
		<input type="hidden" th:name="${_csrf.parameterName}"	th:value="${_csrf.token}"/>
		<div class="row cl">
			<label class="form-label col-sm-2"><span class="c-red">*</span>产品Banner图：</label>
			  <div class="col-sm-3  pr-5">
				<div class="col-sm-6 pl-5 pr-5	  ">
					<img th:src="'/'+${throughTrain.bannerImg}" alt="Banner图" id="editImg" class="thumbnail"/>
				</div>
				<div class=" col-sm-6 pl-5 pr-5 f-12 pos-r" style="right: 20px">
				<blockquote style="border: none;"><small>小余100K</small><small>200（宽）*100（高）</small></blockquote>
				</div>
			</div>
			<div class="col-sm-4 pl-5">
				<span class="btn-upload form-group">
				 <input class="input-text upload-url radius" type="text" name="uploadfile-1" id="uploadfile-1" readonly="readonly" />
				  <a href="javascript:void();"  class="btn btn-primary radius">浏览文件</a>		  
				  <input type="file" id="" name="files" class="input-file"/>				  				  
				</span>
				<button id="btnSubmit0" type="submit" class="btn btn-primary radius mt-10">确定上传</button>	
				<div class="Huialert Huialert-success mt-10" id="result" style="float: right;margin-right: 60px; padding: 0;"><i class="icon-remove"></i></div>
			</div>
			<input type="hidden" name="bannerImg" id="bannerImg" th:value="${throughTrain.bannerImg}"/>	
		</div>
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>路途介绍：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<div  class="formControls  col-sm-7 col-sm-offset-2">
	  			<textarea id="introducePlace" th:text="${throughTrain.introducePlace}"   name="introducePlace" ></textarea>
	  			</div>
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>服务介绍：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<div  class="formControls  col-sm-7 col-sm-offset-2">
	  			<textarea id="introduceServer" th:text="${throughTrain.introduceServer}"   name="introduceServer" ></textarea>
	  			</div>
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>产品特色：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<div  class="formControls  col-sm-7 col-sm-offset-2">
	  			<textarea id="productFeatures" th:text="${throughTrain.productFeatures}"   name="productFeatures" ></textarea>
	  			</div>
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>行程安排：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<div  class="formControls  col-sm-7 col-sm-offset-2">
	  			<textarea id="scheduling" th:text="${throughTrain.scheduling}"   name="scheduling" ></textarea>
	  			</div>
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>须知：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<div  class="formControls  col-sm-7 col-sm-offset-2">
	  			<textarea id="notice" th:text="${throughTrain.notice}"   name="notice" ></textarea>
	  			</div>
			</div>
		</div>
		<div class="row cl">
			<div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-3">
				<button id="btnSubmit1" type="submit" class="btn btn-primary radius mt-10">提交</button>	
			</div>
		</div>
	</form>
	
	<!-- 添加直通车 -->
	<form th:unless="${throughTrain}" action="/shop/shopAdd"  method="post" class="form form-horizontal" id="form-member-add">
		<input type="hidden"  th:name="${_csrf.parameterName}"
		th:value="${_csrf.token}"/>
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>商品名：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<input type="text" class="input-text"  placeholder="" name="name" />
				
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>价格：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<input  type="text" class="input-text"  placeholder="99"  name="price"/>
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-sm-2"><span class="c-red">*</span>产品Banner图：</label>
			  <div class="col-sm-3  pr-5">
				<div class="col-sm-6 pl-5 pr-5	  ">
					<img src="/images/u9697.png" alt="Banner图" id="editImg" class="thumbnail"/>
				</div>
				<div class=" col-sm-6 pl-5 pr-5 f-12 pos-r" style="right: 20px">
				<blockquote style="border: none;"><small>小余100K</small><small>200（宽）*100（高）</small></blockquote>
				</div>
			</div>
			<div class="col-sm-4 pl-5">
				<span class="btn-upload form-group">
				 <input class="input-text upload-url radius" type="text" name="uploadfile-1" id="uploadfile-1" readonly="readonly" />
				  <a href="javascript:void();"  class="btn btn-primary radius">浏览文件</a>		  
				  <input type="file" id="" name="files" class="input-file"/>				  				  
				</span>
				<button id="btnSubmit0" type="submit" class="btn btn-primary radius mt-10">确定上传</button>	
				<div class="Huialert Huialert-success mt-10" id="result" style="float: right;margin-right: 60px; padding: 0;"><i class="icon-remove"></i></div>
			</div>
			<input type="hidden" name="bannerImg" id="bannerImg" value=""/>	
		</div>
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>路途介绍：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<div  class="formControls  col-sm-7 col-sm-offset-2">
	  			<textarea id="introducePlace" name="introducePlace" ></textarea>
	  			</div>
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>服务介绍：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<div  class="formControls  col-sm-7 col-sm-offset-2">
	  			<textarea id="introduceServer"    name="introduceServer" ></textarea>
	  			</div>
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>产品特色：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<div  class="formControls  col-sm-7 col-sm-offset-2">
	  			<textarea id="productFeatures"  name="productFeatures" ></textarea>
	  			</div>
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>行程安排：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<div  class="formControls  col-sm-7 col-sm-offset-2">
	  			<textarea id="scheduling"    name="scheduling" ></textarea>
	  			</div>
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>须知：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<div  class="formControls  col-sm-7 col-sm-offset-2">
	  			<textarea id="notice"    name="notice" ></textarea>
	  			</div>
			</div>
		</div>
		<div class="row cl">
			<div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-3">
				<button id="btnSubmit1" type="submit" class="btn btn-primary radius mt-10">提交</button>	
			</div>
		</div>
		
	</form>
	
	<div th:if="${edit_success}" class="Huialert Huialert-success mt-20"><i class="icon-remove"></i>修改成功</div>
	<div th:if="${add_success}" class="Huialert Huialert-success mt-20"><i class="icon-remove"></i>添加成功</div>
	<div th:if="${add_error}" class="Huialert Huialert-error mt-20"><i class="icon-remove"></i>添加失败，用户名已存在</div>
</article>

<!--_footer 作为公共模版分离出去-->
<script type="text/javascript" src="/lib/jquery/1.9.1/jquery.min.js"></script>
<script type="text/javascript" src="/lib/layer/2.1/layer.js"></script>
<script type="text/javascript" src="/lib/icheck/jquery.icheck.min.js"></script>
<script type="text/javascript" src="/lib/jquery.validation/1.14.0/jquery.validate.min.js"></script>
<script type="text/javascript" src="/lib/jquery.validation/1.14.0/validate-methods.js"></script>
<script type="text/javascript" src="/lib/jquery.validation/1.14.0/messages_zh.min.js"></script>
<script type="text/javascript" src="/static/h-ui/js/H-ui.js"></script>
<script type="text/javascript" src="/static/h-ui.admin/js/H-ui.admin.js"></script>
<script type="text/javascript" src="/lib/jquery/jquery.form.min.js"></script>
<!--/_footer /作为公共模版分离出去-->

<!--请在下方写此页面业务相关的脚本-->
<script type="text/javascript" src="/lib/ckeditor/ckeditor.js"></script>
<script type="text/javascript" src="/js/updataImg.js"></script>
<script type="text/javascript" src="/js/edit.js"></script>
<script type="text/javascript" src="/js/demo.js"></script>
<script type="text/javascript">

CKEDITOR.replace('introducePlace');
CKEDITOR.replace('introduceServer');
CKEDITOR.replace('productFeatures');
CKEDITOR.replace('scheduling');
CKEDITOR.replace('notice');

function CKupdate(){
    for(instance in CKEDITOR.instances)
        CKEDITOR.instances[instance].updateElement();
}
/*  $(document).ready(function() { 
    // bind 'myForm' and provide a simple callback function 
	 $('#form-member-add').ajaxForm(function() { 
         alert("Thank you for your comment!"); 
     }); 
});   */


$("#btnSubmit0").click(function (event) {
	event.preventDefault();
	fire_ajax_submit("#form-member-add","#btnSubmit0","#result","#editImg","#bannerImg");	
});
/* 让富文本的内容更新 */
function CKupdate(){
    for(instance in CKEDITOR.instances)
        CKEDITOR.instances[instance].updateElement();
}
$("#btnSubmit1").click(function (event) {
	event.preventDefault();
	CKupdate();
	$('#form-member-add').ajaxSubmit();
	var index = parent.layer.getFrameIndex(window.name);
	parent.$('#btn-refresh').click();
	parent.layer.close(index);
});
</script>
<!--/请在上方写此页面业务相关的脚本-->
</body>
</html>
